#pragma once
#include "StdAfx.h"


/*
	This is the Rotator class that will be used to rotate objects in the scene. 
	It contains yaw, pitch and roll components in degrees and is used as an adapter between the user and the 3x3 matrices.
	The idea comes from the Rotator used in Epic's Unreal technology, except that it uses degrees instead of Unreal Rotation Units.

	Written by Arseni Natapov, 1/5/2011;
*/
class Rotator
{
public:
	Rotator(real yaw=0, real pitch=0, real roll=0);
	//Rotator(Rotator&);
	~Rotator(void);

	//rotator components
	real yaw, pitch, roll; //degrees

	//rotator functions
	//resets the rotator to 0,0,0
	void Reset();
	//operators
	//casting operators
	//returns a rotated 1,0,0 vector 
	operator Vec3();
	//returns a rotational matrix
	operator Mat33();
	//returs the quaternion representing this rotation
	operator Quat();
	//assignment operator
	Rotator operator =(Rotator&);
	Rotator operator =(Vec3&);
	Rotator operator -();
	//comparison operators
	bool operator ==(Rotator&);
	bool operator !=(Rotator&);
	//arithmetic operators
	Rotator operator +(Rotator&);
	void operator +=(Rotator&);
	Rotator operator -(Rotator&);
	void operator -=(Rotator&);
	void Rotate(Vec3&);
};

